package com.example.dowertefense;

import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.RectF;
import android.view.View;

import com.example.dowertefense.ObjectManager;

public class GameObject extends View{

	public int x;
	public int y;
	
	private float velX;
	private float velY;
	RectF r;
	Paint paint;
	
	public GameObject(Context context) {
		super(context);
		velX = .5f;
		r = new RectF(10, 10, 10, 10);
		paint = new Paint();
		paint.setColor(15);
		// TODO Auto-generated constructor stub
	}
	
	private int ID;
	
	//private Image picture;    Don't know the class needed
	
	private int health;
	@Override
	public void onDraw(Canvas canvas)
	{
		r.offset(velX, 0);
		canvas.drawRect(r, paint);
	}
	
	public int getHealth()
	{
		return health;
	}
	
	public void Update()
	{
		x += velX;
		y += velY;
		if(health <= 0)
			ObjectManager.RemoveObject(this);
	}
}
